package com.itheima.ydd.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

import java.util.List;

/**
 * 自定义分页构造器
 * 逻辑视图
 * @param <T>
 */
@Data
public class NewPageDto<T> extends Page<T> {
    //总数
    public Long getCount(){
        return super.getTotal();
    }
    //总页数
    public Long getTotalPages(){
        return super.getPages();
    }
    //每页数量
    public Long getPageSize(){
        return super.getSize();
    }
    //当前页码
    public Long getCurrentPage(){
        return super.getCurrent();
    }
    //列表数据
    public List<T> getData(){
        return super.getRecords();
    }

    //无参构造
    public NewPageDto() {
    }

    //带参构造
    public NewPageDto(long current, long size) {
        super(current, size);
    }

    public NewPageDto(long current, long size, long total) {
        super(current, size, total);
    }

    public NewPageDto(long current, long size, boolean isSearchCount) {
        super(current, size, isSearchCount);
    }

    public NewPageDto(long current, long size, long total, boolean isSearchCount) {
        super(current, size, total, isSearchCount);
    }
}
